package com.dkakunsi.monev.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.dkakunsi.monev.dao.ProgramDao;
import com.dkakunsi.monev.entity.Program;
import com.dkakunsi.monev.util.MonevDataException;

@Service("programService")
@Transactional(readOnly=true)
public class ProgramService extends MonevAbstractService {
	@Autowired private ProgramDao dao;
	
	@Transactional(readOnly=false)
	public void save(Program program) {
		dao.save(program);
	}
	
	public void delete(Program program) {
		dao.delete(program);
	}
	
	public Program get(Object key) throws MonevDataException {
		return dao.get(key);
	}
	
	public List<Program> getAll() throws MonevDataException {
		return dao.getAll();
	}
	
	public List<Program> getByName(String name) throws MonevDataException {
		return dao.getByName(name);
	}
}
